#ifndef CM_WINDOW_HPP
#define CM_WINDOW_HPP

#ifdef WIN32
#include <windows.h>
#endif

#include "ge_color.hpp"
#include "cm_drawable.hpp"

#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
#include <vector>

namespace cm {
  /// Singleton to create window and initialize all the OpenGL components
  class window {
  public:
    /// Constructor takes as parameter the background color
    window(ge::color const & c, int const width = 600, int const height = 375);
    
    /** Resize function will be called whenever you resize the window (from the mouse)
      @note You probably don't need to worry about this.
    */
    static void resize(GLsizei w, GLsizei h);
    
    static void display();
    static void add(drawable const &);
    static void start();
    
  private:
    static ge::color _background_color;
    static int _width, _height;
    static bool _created;
    typedef std::vector<drawable const *> drawables;
    static drawables _drawables;
  };
}

#endif
